package com.zm.Study05_BufferedInputStream;



import java.io.*;

public class BufferedInputStreamDemo01 {

    public static void main(String[] args) throws IOException {
        FileInputStream fis=new FileInputStream("D:\\project\\IDEAPROJECT\\JavaIO\\src\\main\\resources\\static\\BuferedInputStreamTxt\\bis.txt");
        BufferedInputStream bis=new BufferedInputStream(fis);
        int by;
     /*  //一次读取一个字节
      while ((by=bis.read())!=-1){
            System.out.print((char)by);
        }*/

        //一次读取一个字节数组
        byte[] bytes=new byte[1024];
        int len;
        while ((len=bis.read(bytes))!=-1){
            System.out.print(new String(bytes,0,len));
        }
        bis.close();
        fis.close();
    }
}

//复制视频练习
// 结果：缓冲流，一次一个数组 最快
